#ifndef INSTANCE_OVERTIME_H
#define INSTANCE_OVERTIME_H

/*	CLASS:		InstanceOvertime
	AUTHOR:		Marcelo Y. B. Hossomi

	Contains instance specific data with overtime.
*/

#include "Instance.h"
#include "Input.h"

class InstanceOvertime: public Instance {
private:

	SingleIntParam		J, Je, T, M;
	MatrixDoubleParam	capacityCost;		// J x M
	ArrayDoubleParam	setupCost;			// J
	MatrixDoubleParam	overtimeCost;		// M x T
	MatrixDoubleParam	upperBound;			// J x T
	MatrixDoubleParam	capacity;			// M x T
	MatrixDoubleParam	demand;				// J x T
	ArrayDoubleParam	holdingCost;		// J
	MatrixDoubleParam	resourceCost;		// J x J
	MatrixDoubleParam	setupTime;			// M x J

	ArrayDoubleParam	eHoldingCost;		// J
	MatrixDoubleParam	eDemand;			// J x T
	CubeDoubleParam		lsDemand;			// J x T x T

	ArrayIntParam		prodMachine;		// J
	ArrayIntParam		successorCount;		// J
	MatrixIntParam		successor;			// J x ?
	
	double calcEchelonDemand( int j, int t ) throw (NotReady, InvalidIndex);
	double calcTotalEchelonDemand( int j, int t ) throw (NotReady, InvalidIndex);

public:
	
	static const char	*SUBDIR;

	// Initializes all fields.
	InstanceOvertime();

	// Cleans all allocated memory.
	~InstanceOvertime();

	// Loads an instance.
	bool load( const char *name ) throw (NotReady, InvalidIndex, Exception);

	// Returns the instance full path.
	static char* getPath( const char *name );

	// Returns solution size info.
	int getSolSize() throw (NotReady);
	int getSolCols() throw (NotReady);
	int getSolRows() throw (NotReady);

	// Prints this instance data.
	void print() throw (NotReady);

};

#endif